<?php

class Users
{
	private $users=array();
	protected $sql = "SELECT m.SnapUserID, m.SnapUserGroupID, u.SnapUserID, u.LongName, u.ShortName, u.Password, u.email, g.GroupName
		FROM 
		(SnapUserGroupMembers AS m
		INNER JOIN SnapUsers AS u ON m.SnapUserID = u.SnapUserID)
		INNER JOIN SnapUserGroups as g ON g.SnapUserGroupID = m.SnapUserGroupID";
	
	public function __construct()
	{
		$database=$GLOBALS['DATABASE']->Recopy();
		$database->executeSQL($this->sql);
		while($row=$database->getRow())
		{
			$this->users[$row['SnapUserID']]=$row;
		}
//		echo $this->sql."<br><br>\n\n";
		
	}
	
	public function getUsers(){return $this->users;}
	
/*	public function requestPassword($UserID)
	{
		$password = "";
		foreach ($this->users as $UserID)
		{
			$user = new User($UserID);
			echo $user->getLongName."\n<br>";
		}
	}
*/	
}
